package com.geostar.constructionland.attachment.service;

import com.geostar.constructionland.attachment.entity.FileDownVo;
import com.geostar.constructionland.attachment.entity.GeoAttachment;
import com.geostar.constructionland.attachment.entity.RepEntity;
import com.geostar.constructionland.attachment.entity.vo.UploadPreVo;

/**
 * @author : yell
 * @Description: 文件服务
 * @date : 2020/01/04 15:17
 */
public interface IAttachmentService {
    /**
     * 上传预处理
     *
     * @param geoAttachment 上传附件信息
     * @return
     */
    UploadPreVo preUpload(GeoAttachment geoAttachment);

    /**
     * 分片上传
     *
     * @param geoAttachment 上传附件信息
     * @return
     */
    RepEntity uploadByChunks(GeoAttachment geoAttachment);


    /**
     * 文件上传
     *
     * @param geoAttachment
     * @return
     */
    RepEntity upload(GeoAttachment geoAttachment) throws Exception;


    /***
     * 下载附件
     * @param attachId
     * @return
     */
    FileDownVo downLoadFile(String attachId);

    /**
     * 合并分片
     *
     * @param geoAttachment
     * @return
     */
    RepEntity mergeChunks(GeoAttachment geoAttachment);

    /**
     * 上传图片以及缩略图
     *
     * @param geoAttachment
     * @return
     */
    RepEntity uploadImageAndCreateThumbnail(GeoAttachment geoAttachment);

    /**
     * 上传word以及转换为PDF
     * @param geoAttachment
     * @return
     */
    RepEntity uploadWordAndTranToPdf(GeoAttachment geoAttachment);
}
